import {Form, Button, Input, Row, Col, Cascader, DatePicker,InputNumber,Radio } from 'antd';
import moment from 'moment';
const FormItem = Form.Item;

function query({form, onOk }){

  const {getFieldDecorator,getFieldsValue,resetFields} = form;
  const formItemLayout = {
    // labelCol: { span: 7 },
    wrapperCol: { span: 16 },
    colon:false,
  };
  const submit = () => {
    const values = getFieldsValue();
    onOk(values);

  };

  const reset = () => {
    resetFields();
  }
  return(
    <Form
      onSubmit={submit}

    >
      <Row>
        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('check',)(
                <Input style={{height:29, width:370 }} placeholder='账单信息名称'/>
              )
            }
          </FormItem>
        </Col>
        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('payment',)(
                <Input style={{height:29, width:370}} placeholder='付款方名称'/>
              )
            }
          </FormItem>
        </Col>
        <Col span={8}>
          <FormItem
            wrapperCol={{ span: 8}}
            labelCol= {{ span: 5 }}
            label='是否有效'
          >
            {
              getFieldDecorator('sex', )(
                <Radio.Group>
                  <Radio value={1}>是</Radio>
                  <Radio value={0}>否</Radio>
                </Radio.Group>
              )
            }
          </FormItem>
        </Col>


        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('customerName', )(
                <Input style={{height:29, width:370}} placeholder='客户中文名称'/>
              )
            }
          </FormItem>
        </Col>
        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('customerNum',)(
                <Input style={{height:29, width:370}} placeholder='客户编号'/>
              )
            }
          </FormItem>
        </Col>

        <Col span={8} style={{ textAlign: 'right'}}>
          <Button type='primary' icon='search' onClick={submit} style={{ marginRight: 20}}>查 询</Button>
          <Button onClick={reset} style={{ marginRight: 20}}>清 除</Button>
        </Col>
      </Row>

    </Form>

  )
}
function save(){
  <Form>
    <Row>
      <Button type="primary">Primary</Button>
    </Row>
  </Form>
}


export default Form.create()(query);
